home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / DiceSource / master / Examples / Exec_Dev / defs.h next >
C/C++ Source or Header  |  1994-02-01  |  2KB  |  83 lines

  1.  
  2. /*
  3.  *  DEFS.H
  4.  */
  5.  
  6. #define DEBUG 1
  7.  
  8. #include <exec/types.h>
  9. #include <exec/nodes.h>
  10. #include <exec/errors.h>
  11. #include <exec/memory.h>
  12. #include <exec/libraries.h>
  13. #include <devices/trackdisk.h>
  14. #include <dos/dos.h>
  15. #include <dos/dosextens.h>
  16. #include <stdio.h>
  17. #define abs
  18. #include <clib/exec_protos.h>
  19. #include <clib/dos_protos.h>
  20. #include <clib/alib_protos.h>
  21. #include <string.h>
  22. #include <stdio.h>
  23.  
  24. extern struct Library *SysBase;
  25. extern struct DosLibrary *DosBase;
  26. #include <pragmas/exec_pragmas.h>
  27. #include <pragmas/dos_pragmas.h>
  28.  
  29. #define Prototype extern
  30. #define DevCall __geta4 __regargs
  31.  
  32. #define CMD_OPENUNIT    (0x7FF0 & ~TDF_EXTCOM)
  33. #define CMD_CLOSEUNIT    (0x7FF1 & ~TDF_EXTCOM)
  34. #define CMD_KILLPROC    (0x7FF2 & ~TDF_EXTCOM)
  35.  
  36. #define EXT_CHUNK   4096
  37.  
  38. typedef struct Library    LIB;
  39. typedef struct Device    DEV;
  40. typedef struct Process    PROC;
  41. typedef struct MsgPort    PORT;
  42. typedef struct Message    MSG;
  43. typedef struct List    LIST;
  44. typedef struct Node    NODE;
  45. typedef long (*func_ptr)();
  46.  
  47. typedef struct {
  48.     struct  Unit    U;
  49.     UWORD   OpenCnt;
  50.     long    Fh;     /*  file handle         */
  51.     long    Size;    /*  current size        */
  52.     long    Pos;    /*  current position        */
  53.     char    Extended;    /*  file has been extended  */
  54.     char    Reserved;
  55. } NDUnit;
  56.  
  57. typedef struct {
  58.     LIB     Lib;
  59.     NDUnit  Unit[32];
  60. } NDev;
  61.  
  62. typedef struct {
  63.     struct  Message io_Message;
  64.     struct  Device  *io_Device;     /* device node pointer  */
  65.     struct  Unit    *io_Unit;        /* unit (driver private)*/
  66.     UWORD   io_Command;         /* device command */
  67.     UBYTE   io_Flags;
  68.     BYTE    io_Error;            /* error or warning num */
  69.     ULONG   io_Actual;            /* actual number of bytes transferred */
  70.     ULONG   io_Length;            /* requested number bytes transferred*/
  71.     APTR    io_Data;            /* points to data area */
  72.     ULONG   io_Offset;            /* offset for block structured devices */
  73.  
  74.     long    iotd_Count;         /*    (extension)     */
  75.     long    iotd_SecLabel;        /*    (extension)     */
  76. } IOB;
  77.  
  78. extern char DeviceName[];
  79. extern char IdString[];
  80. extern void DUMmySeg(void);
  81. extern void ADevExpunge(void);
  82.  
  83.